﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DepartmentSearch.ascx.cs" Inherits="GPSTrackingWebsiteManager.Manager.UserControls.DepartmentSearch" %>
<style type="text/css">
    .auto-style1 {
        width: 100%;
    }
    .hidden
    {
        display:none;
    }
</style>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">

        function OpenDepartmentSearch() {
            var wnd = $find('<%=rwDepartmentSearch.ClientID %>');
                    wnd.show();
                }

                function CloseDepartmentSearch() {
                    var wnd = $find('<%=rwDepartmentSearch.ClientID %>');
                    wnd.close();
                }

    </script>
</telerik:RadScriptBlock>
<table class="auto-style1">
    <tr>
        <td rowspan="2" style="text-align:right">
            <telerik:RadButton ID="btnDepartmentSearch" runat="server" Text="Buscador" Height="32px" Width="32px" AutoPostBack="False" OnClientClicked="OpenDepartmentSearch" ToolTip="Asociar Departamento">
                <Image ImageUrl="../../Template/Icons/32px/add-event-icon.png" />
            </telerik:RadButton>
        </td>
    </tr>
</table>
<telerik:RadWindow ID="rwDepartmentSearch" runat="server" Width="420px" Height="500px" EnableShadow="true" Behaviors="Move,Close" ShowContentDuringLoad="false" VisibleStatusbar="false" Modal="true">
    <ContentTemplate>
        <fieldset>
            <legend>Buscador de Departamentos</legend>
            <table class="auto-style1">
                <tr>
                    <td>Departamento</td>
                </tr>
                <tr>
                    <td>
                        <telerik:RadTextBox ID="txtSearchDepartmentName" runat="server" Width="100%">
                        </telerik:RadTextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" style="text-align: center">
                        <telerik:RadButton ID="btnSearchDepartment" runat="server" Text="Buscar" OnClick="btnDepartmentSearch_Click">
                        </telerik:RadButton>
                    </td>
                </tr>

                <tr>
                    <td colspan="4" style="text-align: left">
                        <telerik:RadGrid ID="DepartmentGrid" runat="server" AutoGenerateColumns="False" AllowMultiRowSelection="true" CellSpacing="0" GridLines="None" Height="260px">
                            <ClientSettings>
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>
                            <MasterTableView EditMode="PopUp" EditFormSettings-PopUpSettings-Modal="true" EditFormSettings-CaptionFormatString="Modo Edición" NoMasterRecordsText="No hay registros encontrados">
                                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

                                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </RowIndicatorColumn>

                                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </ExpandCollapseColumn>

                                <Columns>
                                    <telerik:GridClientSelectColumn DataType="System.Boolean" FilterControlAltText="Filter Selected column" UniqueName="Selected" ItemStyle-Width="20px">
                                    </telerik:GridClientSelectColumn>
                                    <telerik:GridBoundColumn DataField="DepartmentID" FilterControlAltText="Filter GPSUsername column" HeaderText="Departamento ID" UniqueName="DepartmentID" ForceExtractValue="Always" HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Name" FilterControlAltText="Filter Name column" HeaderText="Nombre" UniqueName="Name">
                                    </telerik:GridBoundColumn>
                                </Columns>

                                <EditFormSettings>
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                                </EditFormSettings>

                                <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                            </MasterTableView>

                            <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>

                            <FilterMenu EnableImageSprites="False"></FilterMenu>
                        </telerik:RadGrid>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" style="text-align: center">
                        <telerik:RadButton ID="btnDepartmentOK" runat="server" Text="Aceptar" OnClick="btnDepartmentOK_Click"></telerik:RadButton>
                        <telerik:RadButton ID="btnDepartmentCancel" runat="server" Text="Cancelar" AutoPostBack="false" OnClientClicked="CloseDepartmentSearch"></telerik:RadButton>
                    </td>
                </tr>
            </table>
        </fieldset>
        <telerik:RadWindowManager ID="RadWindowManager2" runat="server"></telerik:RadWindowManager>
    </ContentTemplate>
</telerik:RadWindow>
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnDepartmentSearch">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="DepartmentGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="btnSearchDepartment">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="DepartmentGrid" UpdatePanelCssClass="" />                
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
